
MAX_EXTNAME_SIZE = 5

def extname(name):
    result = ''
    index = name.rfind('.')
    if index != -1 and index + 1 < len(name):
        result = name[index+1:]
        if len(result) > MAX_EXTNAME_SIZE:
            result = ''
    return result
